﻿using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.Json.Serialization;

namespace Furion.Core
{

    /// <summary>
    /// 文件
    /// </summary>
    [Comment("文件")]
    public class SysFile : IEntity
    {
        public SysFile()
        {
            CreatedTime = DateTime.Now;
        }


        [Key]
        [DatabaseGeneratedAttribute(DatabaseGeneratedOption.None), Comment("主键")]
        public long Id { get; set; }


        /// <summary>
        /// 原文件名称
        /// </summary>
        [MaxLength(50), Comment("原文件名称")]
        public string OriginName { get; set; }




        /// <summary>
        /// 后缀名称
        /// </summary>
        [MaxLength(20), Comment("后缀名称")]
        public string ExtName { get; set; }

        /// <summary>
        /// 文件大小
        /// </summary>
        [Comment("文件大小")]
        public int FileLength { get; set; }


        /// <summary>
        /// 文件名称
        /// </summary>
        [MaxLength(20), Comment("文件名称")]
        public string FileName { get; set; }


        /// <summary>
        /// 存储路径
        /// </summary>
        [MaxLength(50), Comment("存储路径")]
        public string FilePath { get; set; }


        /// <summary>
        /// Web路径
        /// </summary>
        [MaxLength(100), Comment("Web路径")]
        public string WebPath { get; set; }


        /// <summary>
        /// 
        /// </summary>
        [Comment("创建时间")]
        public DateTime CreatedTime { get; set; }


        /// <summary>
        /// 创建者Id
        /// </summary>
        [Comment("创建者Id")]
        public long? CreatedUserId { get; set; }

        /// <summary>
        /// 创建者名称
        /// </summary>
        [Comment("创建者名称")]
        [MaxLength(20)]
        public string CreatedUserName { get; set; }



        /// <summary>
        /// 软删除
        /// </summary>
        [JsonIgnore]
        [Comment("软删除标记")]
        public bool IsDeleted { get; set; } = false;



    }
}
